﻿#ifndef MSERVER_H
#define MSERVER_H

#include <QObject>
#include <QTcpServer>

class MServerPrivate;
class MServer : public QObject
{
    Q_OBJECT
public:
    explicit MServer(QObject *parent = nullptr);
    ~MServer();
public slots:
    void initReady();
    void connectionSwitch(qintptr sktDescriptor=0);
    void groupReleaseSpace();
    void onlineCountChange(bool isAdd);
signals:
    void newLog(const QString &from,const QString &content);
private:
    MServerPrivate *d;
};

class MTcpServer : public QTcpServer
{
    Q_OBJECT
public:
    MTcpServer(QObject *parent=nullptr);
    ~MTcpServer();
signals:
    void newIncomingConnection(qintptr sktDescriptor);
protected:
    void incomingConnection(qintptr sktDescriptor);
};

#endif // MSERVER_H
